﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core.Lister;
using COFE.Core.Utils;
using COFE.Core.Filter;
using COFE.Core.EntryType;
using COFE.Core.Profile;
using COFE.Core.Logger;
using COFE.Core.Entry;

namespace COFE.Core.Plugin
{
    public abstract class COFEPluginBase : PluginBase, ICOFEPlugin
    {
        #region Constructor

        public COFEPluginBase(int priority)
            : base(priority)
        {

        }


        #endregion

        #region Methods

        protected void registerProperties<T>()
        {
            foreach (var value in Enum.GetValues(typeof(T)))
                _properties.Add(value);
        }

        #endregion

        #region Data

        protected List<IFactory<IDirectoryLister>> _directoryListerFactories = new List<IFactory<IDirectoryLister>>();
        protected List<object> _properties = new List<object>();
        protected List<Type> _entryFilters = new List<Type>();
        protected List<Type> _lookupFilters = new List<Type>();
        protected List<Tuple<Type, IEntryTypeIconProvider>> _entryFilterIconProviders = new List<Tuple<Type, IEntryTypeIconProvider>>();
        protected List<ISecondaryPropertyProvider<IEntryList>> _entryListPropertyProviders = new List<ISecondaryPropertyProvider<IEntryList>>();
        protected List<ISecondaryPropertyProvider<IFileSystemInfo>> _entryPropertyProviders = new List<ISecondaryPropertyProvider<IFileSystemInfo>>();
        protected List<ISecondaryPropertyProvider<IEventLog>> _eventLogPropertyProviders = new List<ISecondaryPropertyProvider<IEventLog>>();

        #endregion

        #region Public Properties

        public IVolumeRegistrar VolumeRegistrar { get; protected set; }
        public ISecondaryPropertyProviderManager SecondaryPropertyProviderManager { get; protected set; }
        public IPropertyDictionary PropertyDictionary { get; protected set; }
        public IPathParser PathParser { get; protected set; }
        public IEntryConstructor EntryConstructor { get; protected set; }
        public IEntryListRegistrar EntryListRegistrar { get; protected set; }
        public IUserProfileManager UserProfileManager { get; protected set; }
        public IEntryTypeDictionary EntryTypeDictionary { get; protected set; }

        public IEventDispatcher<FileSystemEventArgsExA> FileSystemEventDispatcher { get; protected set; }
        public IEventLogger<FileSystemEventArgsExA> FileSystemEventLogger { get; protected set; }

        public List<IFactory<IDirectoryLister>> DirectoryListerFactories { get { return _directoryListerFactories; } }
        public List<object> Properties { get { return _properties; } }
        public List<Type> EntryFilters { get { return _entryFilters; } }
        public List<Tuple<Type, IEntryTypeIconProvider>> EntryFilterIconProviders { get { return _entryFilterIconProviders; } }
        public List<Type> LookupFilters { get { return _lookupFilters; } }
        public List<ISecondaryPropertyProvider<IEntryList>> EntryListPropertyProviders { get { return _entryListPropertyProviders; } }
        public List<ISecondaryPropertyProvider<IFileSystemInfo>> EntryPropertyProviders { get { return _entryPropertyProviders; } }
        public List<ISecondaryPropertyProvider<IEventLog>> EventLogPropertyProviders { get { return _eventLogPropertyProviders; } }

        #endregion

    }
}
